<template>
	<view class="todo-list">
			<view class="todo-task-list" style="width: 90%;margin-top: 50rpx;">
				<view class="simple-card todo-list-card" v-for="(item,index) in list" :key="index" style="padding: 10rpx;">
					<view class="simple-header" style="width: 100%">
						<view class="simple-title" style="width: 100%">
							<view class="simple-status">
							</view>
							<view class="simple-title-text">
								<span>排班日期：{{ item.beginDate }} ~ {{ item.endDate }}</span>
							</view>
						</view>
					</view>
					<view class="simple-card-content" style="margin-top: 20rpx;">
						上班时间：{{ item.startTime ? item.startTime : '' }}</view>
					<view class="simple-card-content" style="margin-top: 20rpx;">下班时间：{{ item.endTime }}</view>
			
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				list: [],
				id: ""
			}
		},
		onLoad(val) {
			this.id = uni.getStorageSync("userInfo").userId
			this.changeType()
		},
		methods: {
			// 盘点类型
			changeType(val) {
				this.$request('', '/system/time/list', 'get', {
					pageNum: 1,
					pageSize: 99,
					userId:this.id 
				}, {}, )
					.then(
						res => {
							const {
								rows
							} = res;
							// console.log(rows)
							this.list = rows;
						})
			}
		}
	}
</script>

<style lang="scss">
	.todo-list {
		overflow: scroll;
		background-color: #fff;
		height: 100vh;
		width: 100%;
		display: flex;
		align-items: center;
		flex-direction: column;
	
		.todo-list-card {
			+.todo-list-card {
				margin-top: 10rpx;
			}
	
			.simple-card-content {
				color: #aaaaaa;
			}
		}
	}
	
	.todo-task-list {
		display: flex;
		flex-direction: column;
		width: 100%;
	}
	
	.simple-card-content{
		padding-left: 20rpx;
		padding-right: 20rpx;
		margin-bottom: 20rpx;
	}
	
	.simple-header {
	    align-items: center;
	    justify-content: space-between;
	    display: flex;
		padding: 20rpx;
	    .simple-title {
	      align-items: center;
	      display: flex;
	      max-width: 75%;
	
	      .simple-status, .simple-title-text {
	        display: flex;
	        align-items: center;
	      }
	      .simple-title-text{
	        font-weight: bold;
	      }
	      .simple-status {
	        margin-right: .25rem;
	        .van-tag {
	          min-width: 2.75rem;
	          line-height: 1.25rem;
	          justify-content: center;
	        }
	      }
	    }
	  }
</style>